home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / bstfiles.zoo / dcu.bst < prev    next >
Text File  |  1992-03-02  |  23KB  |  1,241 lines

  1. % BibTeX standard bibliography style `dcu' (one of the harvard family)
  2.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.     % Copyright (C) 1991, all rights reserved.
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst,
  8.         % dcu.bst or kluwer.bst.
  9.     % This restriction helps ensure that all standard styles are identical.
  10.     % The file harvard.tex has the documentation for this style.
  11.  
  12. % ACKNOWLEDGEMENT:
  13. %   This document is a modified version of alpha.bst to which it owes much of
  14. %   its functionality.
  15.  
  16. % AUTHOR
  17. %   Peter Williams, Key Centre for Design Quality, Sydney University
  18. %   e-mail: peterw@archsci.arch.su.oz.au
  19.  
  20. ENTRY
  21.   { address
  22.     author
  23.     booktitle
  24.     chapter
  25.     edition
  26.     editor
  27.     howpublished
  28.     institution
  29.     journal
  30.     key
  31.     month
  32.     note
  33.     number
  34.     organization
  35.     pages
  36.     publisher
  37.     school
  38.     series
  39.     title
  40.     type
  41.     volume
  42.     year
  43.   }
  44.   { field.used }
  45.   { extra.label sort.label list.year }
  46.  
  47. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  48.  
  49. FUNCTION {init.state.consts}
  50. { #0 'before.all :=
  51.   #1 'mid.sentence :=
  52.   #2 'after.sentence :=
  53.   #3 'after.block :=
  54. }
  55.  
  56. STRINGS { s t f }
  57.  
  58. FUNCTION {output.nonnull}
  59. { 's :=
  60.   output.state mid.sentence =
  61.     { ", " * write$ }
  62.     { output.state after.block =
  63.     { add.period$ write$
  64.       newline$
  65.       "\newblock " write$
  66.     }
  67.     { output.state before.all =
  68.         'write$
  69.         { add.period$ " " * write$ }
  70.       if$
  71.     }
  72.       if$
  73.       mid.sentence 'output.state :=
  74.     }
  75.   if$
  76.   s
  77. }
  78.  
  79. FUNCTION {output}
  80. { duplicate$ empty$
  81.     'pop$
  82.     'output.nonnull
  83.   if$
  84. }
  85.  
  86. FUNCTION {output.check}
  87. { 't :=
  88.   duplicate$ empty$
  89.     { pop$ "empty " t * " in " * cite$ * warning$ }
  90.     'output.nonnull
  91.   if$
  92. }
  93.  
  94. FUNCTION {item.check}
  95. { 't :=
  96.   empty$
  97.     { "empty " t * " in " * cite$ * warning$ }
  98.     { skip$ }
  99.   if$
  100. }
  101.  
  102. FUNCTION {fin.entry}
  103. { add.period$
  104.   write$
  105.   newline$
  106. }
  107.  
  108. FUNCTION {new.block}
  109. { output.state before.all =
  110.     'skip$
  111.     { after.block 'output.state := }
  112.   if$
  113. }
  114.  
  115. FUNCTION {not}
  116. {   { #0 }
  117.     { #1 }
  118.   if$
  119. }
  120.  
  121. FUNCTION {and}
  122. {   'skip$
  123.     { pop$ #0 }
  124.   if$
  125. }
  126.  
  127. FUNCTION {or}
  128. {   { pop$ #1 }
  129.     'skip$
  130.   if$
  131. }
  132.  
  133. FUNCTION {field.or.null}
  134. { duplicate$ empty$
  135.     { pop$ "" }
  136.     'skip$
  137.   if$
  138. }
  139.  
  140. FUNCTION {emphasize}
  141. { duplicate$ empty$
  142.     { pop$ "" }
  143.     { "{\em " swap$ * "}" * }
  144.   if$
  145. }
  146.  
  147. FUNCTION {embolden}
  148. { duplicate$ empty$
  149.     { pop$ "" }
  150.     { "{\bf " swap$ * "}" * }
  151.   if$
  152. }
  153.  
  154. FUNCTION {quote}
  155. { duplicate$ empty$
  156.     { pop$ "" }
  157.     { "`" swap$ * "'" * }
  158.   if$
  159. }
  160.  
  161. INTEGERS { nameptr namesleft numnames }
  162.  
  163. FUNCTION {format.names}
  164. { 's :=
  165.   'f :=
  166.   #1 'nameptr :=
  167.   s num.names$ 'numnames :=
  168.   numnames 'namesleft :=
  169.     { namesleft #0 > }
  170.     { s nameptr f format.name$ 't :=
  171.       nameptr #1 >
  172.     { namesleft #1 >
  173.         { ", " * t * }
  174.         { t "others" =
  175.         { " et~al." * }
  176.         { " and " * t * }
  177.           if$
  178.         }
  179.       if$
  180.     }
  181.     't
  182.       if$
  183.       nameptr #1 + 'nameptr :=
  184.       namesleft #1 - 'namesleft :=
  185.     }
  186.   while$
  187. }
  188.  
  189. FUNCTION {format.authors}
  190. { author empty$
  191.     { "" }
  192.     { "{vv~}{ll}{, jj}{, f.}" author format.names }
  193.   if$
  194. }
  195.  
  196. FUNCTION {format.editors}
  197. { editor empty$
  198.     { "" }
  199.     { "{vv~}{ll}{, jj}{, f.}" editor format.names
  200.       editor num.names$ #1 >
  201.     { " (eds)" * }
  202.     { " (ed.)" * }
  203.       if$
  204.     }
  205.   if$
  206. }
  207.  
  208. FUNCTION {format.editors.reverse}
  209. { editor empty$
  210.     { "" }
  211.     { "{f.~}{vv~}{ll}{, jj}" editor format.names
  212.       editor num.names$ #1 >
  213.     { " (eds)" * }
  214.     { " (ed.)" * }
  215.       if$
  216.     }
  217.   if$
  218. }
  219.  
  220. FUNCTION {format.title}
  221. { title empty$
  222.     { "" }
  223.     { title "t" change.case$ }
  224.   if$
  225. }
  226.  
  227. FUNCTION {n.dashify}
  228. { 't :=
  229.   ""
  230.     { t empty$ not }
  231.     { t #1 #1 substring$ "-" =
  232.     { t #1 #2 substring$ "--" = not
  233.         { "--" *
  234.           t #2 global.max$ substring$ 't :=
  235.         }
  236.         {   { t #1 #1 substring$ "-" = }
  237.         { "-" *
  238.           t #2 global.max$ substring$ 't :=
  239.         }
  240.           while$
  241.         }
  242.       if$
  243.     }
  244.     { t #1 #1 substring$ *
  245.       t #2 global.max$ substring$ 't :=
  246.     }
  247.       if$
  248.     }
  249.   while$
  250. }
  251.  
  252. FUNCTION {format.btitle}
  253. { title emphasize
  254. }
  255.  
  256. FUNCTION {tie.or.space.connect}
  257. { duplicate$ text.length$ #3 <
  258.     { "~" }
  259.     { " " }
  260.   if$
  261.   swap$ * *
  262. }
  263.  
  264. FUNCTION {either.or.check}
  265. { empty$
  266.     'pop$
  267.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  268.   if$
  269. }
  270.  
  271. FUNCTION {format.bvolume}
  272. { volume empty$
  273.     { "" }
  274.     { "Vol." volume tie.or.space.connect
  275.       series empty$
  276.     'skip$
  277.     { " of " * series emphasize * }
  278.       if$
  279.       "volume and number" number either.or.check
  280.     }
  281.   if$
  282. }
  283.  
  284. FUNCTION {format.number.series}
  285. { volume empty$
  286.     { number empty$
  287.     { series field.or.null }
  288.     { output.state mid.sentence =
  289.         { "number" }
  290.         { "Number" }
  291.       if$
  292.       number tie.or.space.connect
  293.       series empty$
  294.         { "there's a number but no series in " cite$ * warning$ }
  295.         { " in " * series emphasize * }
  296.       if$
  297.     }
  298.       if$
  299.     }
  300.     { "" }
  301.   if$
  302. }
  303.  
  304. FUNCTION {format.edition}
  305. { edition empty$
  306.     { "" }
  307.     { output.state mid.sentence =
  308.     { edition "l" change.case$ " edn" * }
  309.     { edition "t" change.case$ " edn" * }
  310.       if$
  311.     }
  312.   if$
  313. }
  314.  
  315. INTEGERS { multiresult }
  316.  
  317. FUNCTION {multi.page.check}
  318. { 't :=
  319.   #0 'multiresult :=
  320.     { multiresult not
  321.       t empty$ not
  322.       and
  323.     }
  324.     { t #1 #1 substring$
  325.       duplicate$ "-" =
  326.       swap$ duplicate$ "," =
  327.       swap$ "+" =
  328.       or or
  329.     { #1 'multiresult := }
  330.     { t #2 global.max$ substring$ 't := }
  331.       if$
  332.     }
  333.   while$
  334.   multiresult
  335. }
  336.  
  337. FUNCTION {format.pages}
  338. { pages empty$
  339.     { "" }
  340.     { pages multi.page.check
  341.     { "pp.~" pages n.dashify * }
  342.     { "p.~" pages * }
  343.       if$
  344.     }
  345.   if$
  346. }
  347.  
  348. FUNCTION {format.vol.num.pages}
  349. { volume embolden field.or.null
  350.   number empty$
  351.     'skip$
  352.     { "(" number * ")" * *
  353.       volume empty$
  354.     { "there's a number but no volume in " cite$ * warning$ }
  355.     'skip$
  356.       if$
  357.     }
  358.   if$
  359.   pages empty$
  360.     'skip$
  361.     { duplicate$ empty$
  362.     { pop$ format.pages }
  363.     { ":~" * pages n.dashify * }
  364.       if$
  365.     }
  366.   if$
  367. }
  368.  
  369. FUNCTION {format.chapter.pages}
  370. { chapter empty$
  371.     'format.pages
  372.     { type empty$
  373.     { "chapter" }
  374.     { type "l" change.case$ }
  375.       if$
  376.       chapter tie.or.space.connect
  377.       pages empty$
  378.     'skip$
  379.     { ", " * format.pages * }
  380.       if$
  381.     }
  382.   if$
  383. }
  384.  
  385. FUNCTION {format.in.ed.booktitle}
  386. { booktitle empty$
  387.     { "" }
  388.     { editor empty$
  389.     { booktitle emphasize }
  390.     { "{\em in} " format.editors.reverse * ", " * booktitle emphasize * }
  391.       if$
  392.     }
  393.   if$
  394. }
  395.  
  396. FUNCTION {empty.misc.check}
  397. { author empty$ title empty$ howpublished empty$
  398.   month empty$ year empty$ note empty$
  399.   and and and and and
  400.   key empty$ not and
  401.     { "all relevant fields are empty in " cite$ * warning$ }
  402.     'skip$
  403.   if$
  404. }
  405.  
  406. FUNCTION {format.thesis.type}
  407. { type empty$
  408.     'skip$
  409.     { pop$
  410.       type "t" change.case$
  411.     }
  412.   if$
  413. }
  414.  
  415. FUNCTION {format.tr.number}
  416. { type empty$
  417.     { "Technical Report" }
  418.     'type
  419.   if$
  420.   number empty$
  421.     { "t" change.case$ }
  422.     { number tie.or.space.connect }
  423.   if$
  424. }
  425.  
  426. FUNCTION {format.article.crossref}
  427. { key empty$
  428.     { journal empty$
  429.     { "need key or journal for " cite$ * " to crossref " * crossref *
  430.       warning$
  431.       ""
  432.     }
  433.     { "in {\em " journal * "\/}" * " \cite{" * crossref * "}" *
  434.         }
  435.       if$
  436.     }
  437.     { " {\em in} \citeasnoun{" crossref * "}" * }
  438.   if$
  439. }
  440.  
  441. FUNCTION {format.book.crossref}
  442. { volume empty$
  443.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  444.       "in "
  445.     }
  446.     { "Vol." volume tie.or.space.connect
  447.       " of " *
  448.     }
  449.   if$
  450.   editor empty$
  451.   editor field.or.null author field.or.null =
  452.   or
  453.     { key empty$
  454.     { series empty$
  455.         { "need editor, key, or series for " cite$ * " to crossref " *
  456.           crossref * warning$
  457.           "" *
  458.         }
  459.         { "{\em " * series * "\/}" * " \cite{" * crossref * "}" *}
  460.       if$
  461.     }
  462.     { " \citeasnoun{" * crossref * "}" * }
  463.       if$
  464.     }
  465.     { " \citeasnoun{" * crossref * "}" * }
  466.   if$
  467. }
  468.  
  469. FUNCTION {format.incoll.inproc.crossref}
  470. { editor empty$
  471.   editor field.or.null author field.or.null =
  472.   or
  473.     {
  474.       key empty$
  475.     { booktitle empty$
  476.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  477.           crossref * warning$
  478.           ""
  479.         }
  480.         { "in {\em " booktitle * "\/}" * " \cite{" * crossref * "}" *}
  481.       if$
  482.     }
  483.     { " {\em in} \citeasnoun{" crossref * "}" * }
  484.       if$
  485.     }
  486.     {  " {\em in} \citeasnoun{" crossref * "}" * }
  487.   if$
  488. }
  489.  
  490. INTEGERS { len }
  491.  
  492. FUNCTION {chop.word}
  493. { 's :=
  494.   'len :=
  495.   s #1 len substring$ =
  496.     { s len #1 + global.max$ substring$ }
  497.     's
  498.   if$
  499. }
  500.  
  501. FUNCTION {format.lab.names.abbr}
  502. { 's :=
  503.   s num.names$ 'numnames :=
  504.   numnames #1 >
  505.     { numnames #2 >
  506.     { s #1 "{vv~}{ll}" format.name$ " et al." * }
  507.     { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  508.             { s #1 "{vv~}{ll}" format.name$ " et al." * }
  509.         { s #1 "{vv~}{ll}" format.name$ " and " *
  510.               s #2 "{vv~}{ll}" format.name$ * 
  511.             }
  512.           if$
  513.         }
  514.       if$
  515.     }
  516.     { s #1 "{vv~}{ll}" format.name$ }
  517.   if$
  518. }
  519.  
  520. FUNCTION {format.lab.names.full}
  521. { 's :=
  522.   #1 'nameptr :=
  523.   s num.names$ 'numnames :=
  524.   numnames 'namesleft :=
  525.     { namesleft #0 > }
  526.     { s nameptr "{vv~}{ll}" format.name$ 't :=
  527.       nameptr #1 >
  528.     { namesleft #1 >
  529.         { ", " * t * }
  530.         { t "others" =
  531.         { " et~al." * }
  532.         { " and " * t * }
  533.           if$
  534.         }
  535.       if$
  536.     }
  537.     't
  538.       if$
  539.       nameptr #1 + 'nameptr :=
  540.       namesleft #1 - 'namesleft :=
  541.     }
  542.   while$
  543. }
  544.  
  545. INTEGERS { author.field editor.field organization.field title.field key.field }
  546.  
  547. FUNCTION {init.field.constants}
  548. { #0 'author.field :=
  549.   #1 'editor.field :=
  550.   #2 'organization.field :=
  551.   #3 'title.field :=
  552.   #4 'key.field :=
  553. }
  554.  
  555. FUNCTION {make.list.label}
  556. { author.field field.used =
  557.     { format.authors }
  558.     { editor.field field.used =
  559.         { format.editors }
  560.         { organization.field field.used =
  561.             { "The " #4 organization chop.word #3 text.prefix$ }
  562.             { title.field field.used =
  563.                 { format.btitle }
  564.                 { key.field field.used =
  565.                     { key #3 text.prefix$ }
  566.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  567.                   if$
  568.                 }
  569.               if$
  570.             }
  571.           if$
  572.         }
  573.       if$
  574.     }
  575.   if$
  576. }
  577.  
  578. FUNCTION {make.full.label}
  579. { author.field field.used =
  580.     { author format.lab.names.full }
  581.     { editor.field field.used =
  582.         { editor format.lab.names.full }
  583.         { organization.field field.used =
  584.             { "The " #4 organization chop.word #3 text.prefix$ }
  585.             { title.field field.used =
  586.                 { format.btitle }
  587.                 { key.field field.used =
  588.                     { key #3 text.prefix$ }
  589.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  590.                   if$
  591.                 }
  592.               if$
  593.             }
  594.           if$
  595.         }
  596.       if$
  597.     }
  598.   if$
  599. }
  600.  
  601. FUNCTION {make.abbr.label}
  602. { author.field field.used =
  603.     { author format.lab.names.abbr }
  604.     { editor.field field.used =
  605.         { editor format.lab.names.abbr }
  606.         { organization.field field.used =
  607.             { "The " #4 organization chop.word #3 text.prefix$ }
  608.             { title.field field.used =
  609.                 { format.btitle }
  610.                 { key.field field.used =
  611.                     { key #3 text.prefix$ }
  612.                     { "Internal error :001 on " cite$ * " label" * warning$ }
  613.                   if$
  614.                 }
  615.               if$
  616.             }
  617.           if$
  618.         }
  619.       if$
  620.     }
  621.   if$
  622. }
  623.  
  624. FUNCTION {output.bibitem}
  625. { newline$
  626.   "\harvarditem[" write$
  627.   make.abbr.label write$
  628.   "]{" write$
  629.   make.full.label write$
  630.   "}{" write$
  631.   list.year write$
  632.   "}{" write$
  633.   cite$ write$
  634.   "}" write$
  635.   newline$
  636.   ""
  637.   before.all 'output.state :=
  638. }
  639.  
  640. FUNCTION {list.label.output}
  641. { make.list.label " " * write$
  642. }
  643.  
  644. FUNCTION {article}
  645. { output.bibitem
  646.   list.label.output
  647.   " (" list.year * ")" * output.nonnull
  648.   new.block
  649.   author "author" item.check
  650.   title.field field.used =
  651.     { skip$ }
  652.     { format.title "title" output.check }
  653.   if$
  654.   crossref missing$
  655.     { journal emphasize "journal" duplicate$ item.check
  656.       pages empty$
  657.         {
  658.           output
  659.         }
  660.         {
  661.           " " *
  662.           format.vol.num.pages * output
  663.         }
  664.       if$
  665.     }
  666.     { format.article.crossref output.nonnull
  667.       format.pages output
  668.     }
  669.   if$
  670.   new.block
  671.   note output
  672.   fin.entry
  673. }
  674.  
  675. FUNCTION {book}
  676. { output.bibitem
  677.   list.label.output
  678.   " (" list.year * ")" * output.nonnull
  679.   new.block
  680.   author empty$
  681.     { editor "author and editor" item.check }
  682.     { crossref missing$
  683.     { "author and editor" editor either.or.check }
  684.     'skip$
  685.       if$
  686.     }
  687.   if$
  688.   title.field field.used =
  689.     { skip$ }
  690.     { format.btitle "title" output.check }
  691.   if$
  692.   crossref missing$
  693.     { format.bvolume output
  694.       format.number.series output
  695.       format.edition output
  696.       publisher "publisher" output.check
  697.       address output
  698.     }
  699.     { format.book.crossref output.nonnull
  700.       format.edition output
  701.     }
  702.   if$
  703.   new.block
  704.   note output
  705.   fin.entry
  706. }
  707.  
  708. FUNCTION {booklet}
  709. { output.bibitem
  710.   list.label.output
  711.   " (" list.year * ")" * output.nonnull
  712.   new.block
  713.   title.field field.used =
  714.     { skip$ }
  715.     { format.title "title" output.check }
  716.   if$
  717.   howpublished output
  718.   address output
  719.   new.block
  720.   note output
  721.   fin.entry
  722. }
  723.  
  724. FUNCTION {inbook}
  725. { output.bibitem
  726.   list.label.output
  727.   " (" list.year * ")" * output.nonnull
  728.   new.block
  729.   author empty$
  730.     { editor "author and editor" item.check }
  731.     { crossref missing$
  732.     { "author and editor" editor either.or.check }
  733.     'skip$
  734.       if$
  735.     }
  736.   if$
  737.   title.field field.used =
  738.     { skip$ }
  739.     { format.btitle "title" output.check }
  740.   if$
  741.   crossref missing$
  742.     { format.bvolume output
  743.       format.number.series output
  744.       format.edition output
  745.       publisher "publisher" output.check
  746.       address output
  747.     }
  748.     { format.book.crossref output.nonnull
  749.       format.edition output
  750.     }
  751.   if$
  752.   format.chapter.pages "chapter and pages" output.check
  753.   new.block
  754.   note output
  755.   fin.entry
  756. }
  757.  
  758. FUNCTION {incollection}
  759. { output.bibitem
  760.   list.label.output
  761.   " (" list.year * ")" * output.nonnull
  762.   new.block
  763.   title.field field.used =
  764.     { skip$ }
  765.     { format.title "title" output.check }
  766.   if$
  767.   author "author" item.check
  768.   crossref missing$
  769.     { format.in.ed.booktitle "booktitle" output.check
  770.       format.edition output
  771.       format.bvolume output
  772.       format.number.series output
  773.       publisher "publisher" output.check
  774.       address output
  775.     }
  776.     { format.incoll.inproc.crossref output.nonnull
  777.     }
  778.   if$
  779.   format.chapter.pages output
  780.   new.block
  781.   note output
  782.   fin.entry
  783. }
  784.  
  785. FUNCTION {inproceedings}
  786. { output.bibitem
  787.   list.label.output
  788.   " (" list.year * ")" * output.nonnull
  789.   new.block
  790.   title.field field.used =
  791.     { skip$ }
  792.     { format.title "title" output.check }
  793.   if$
  794.   author "author" item.check
  795.   crossref missing$
  796.     { format.in.ed.booktitle "booktitle" output.check
  797.       format.bvolume output
  798.       format.number.series output
  799.       address empty$
  800.     { organization output
  801.       publisher output
  802.     }
  803.     { organization output
  804.       publisher output
  805.       address output.nonnull
  806.     }
  807.       if$
  808.     }
  809.     { format.incoll.inproc.crossref output.nonnull
  810.     }
  811.   if$
  812.   format.pages output
  813.   new.block
  814.   note output
  815.   fin.entry
  816. }
  817.  
  818. FUNCTION {conference} { inproceedings }
  819.  
  820. FUNCTION {manual}
  821. { output.bibitem
  822.   list.label.output
  823.   " (" list.year * ")" * output.nonnull
  824.   new.block
  825.   title.field field.used =
  826.     { skip$ }
  827.     { format.btitle "title" output.check }
  828.   if$
  829.   format.edition output
  830.   author empty$
  831.     { organization empty$
  832.     { address output
  833.     }
  834.     'skip$
  835.       if$
  836.     }
  837.     { organization output
  838.       address output
  839.     }
  840.   if$
  841.   new.block
  842.   note output
  843.   fin.entry
  844. }
  845.  
  846. FUNCTION {mastersthesis}
  847. { output.bibitem
  848.   list.label.output
  849.   " (" list.year * ")" * output.nonnull
  850.   new.block
  851.   author "author" item.check
  852.   title.field field.used =
  853.     { skip$ }
  854.     { format.title emphasize "title" output.check }
  855.   if$
  856.   "Master's thesis" format.thesis.type output.nonnull
  857.   school "school" output.check
  858.   address output
  859.   new.block
  860.   note output
  861.   fin.entry
  862. }
  863.  
  864. FUNCTION {misc}
  865. { output.bibitem
  866.   list.label.output
  867.   " (" list.year * ")" * output.nonnull
  868.   new.block
  869.   title.field field.used =
  870.     { skip$ }
  871.     { format.title output }
  872.   if$
  873.   howpublished output
  874.   new.block
  875.   note output
  876.   fin.entry
  877.   empty.misc.check
  878. }
  879.  
  880. FUNCTION {phdthesis}
  881. { output.bibitem
  882.   list.label.output
  883.   " (" list.year * ")" * output.nonnull
  884.   new.block
  885.   author "author" item.check
  886.   title.field field.used =
  887.     { skip$ }
  888.     { format.btitle "title" output.check }
  889.   if$
  890.   "PhD thesis" format.thesis.type output.nonnull
  891.   school "school" output.check
  892.   address output
  893.   new.block
  894.   note output
  895.   fin.entry
  896. }
  897.  
  898. FUNCTION {proceedings}
  899. { output.bibitem
  900.   list.label.output
  901.   " (" list.year * ")" * output.nonnull
  902.   new.block
  903.   title.field field.used =
  904.     { skip$ }
  905.     { format.btitle "title" output.check }
  906.   if$
  907.   format.bvolume output
  908.   format.number.series output
  909.   address empty$
  910.     { editor empty$
  911.     { skip$ }
  912.     { organization output
  913.     }
  914.       if$
  915.       publisher output
  916.     }
  917.     { editor empty$
  918.     'skip$
  919.     { organization output }
  920.       if$
  921.       publisher output
  922.       address output.nonnull
  923.     }
  924.   if$
  925.   new.block
  926.   note output
  927.   fin.entry
  928. }
  929.  
  930. FUNCTION {techreport}
  931. { output.bibitem
  932.   list.label.output
  933.   " (" list.year * ")" * output.nonnull
  934.   new.block
  935.   author "author" item.check
  936.   title.field field.used =
  937.     { skip$ }
  938.     { format.title "title" output.check }
  939.   if$
  940.   format.tr.number emphasize output.nonnull
  941.   institution "institution" output.check
  942.   address output
  943.   new.block
  944.   note output
  945.   fin.entry
  946. }
  947.  
  948. FUNCTION {unpublished}
  949. { output.bibitem
  950.   list.label.output
  951.   " (" list.year * ")" * output.nonnull
  952.   new.block
  953.   author "author" item.check
  954.   title.field field.used =
  955.     { skip$ }
  956.     { format.title "title" output.check }
  957.   if$
  958.   note "note" output.check
  959.   fin.entry
  960. }
  961.  
  962. FUNCTION {default.type} { misc }
  963.  
  964. MACRO {jan} {"January"}
  965.  
  966. MACRO {feb} {"February"}
  967.  
  968. MACRO {mar} {"March"}
  969.  
  970. MACRO {apr} {"April"}
  971.  
  972. MACRO {may} {"May"}
  973.  
  974. MACRO {jun} {"June"}
  975.  
  976. MACRO {jul} {"July"}
  977.  
  978. MACRO {aug} {"August"}
  979.  
  980. MACRO {sep} {"September"}
  981.  
  982. MACRO {oct} {"October"}
  983.  
  984. MACRO {nov} {"November"}
  985.  
  986. MACRO {dec} {"December"}
  987.  
  988. MACRO {acmcs} {"ACM Computing Surveys"}
  989.  
  990. MACRO {acta} {"Acta Informatica"}
  991.  
  992. MACRO {cacm} {"Communications of the ACM"}
  993.  
  994. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  995.  
  996. MACRO {ibmsj} {"IBM Systems Journal"}
  997.  
  998. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  999.  
  1000. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  1001.  
  1002. MACRO {ieeetcad}
  1003.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  1004.  
  1005. MACRO {ipl} {"Information Processing Letters"}
  1006.  
  1007. MACRO {jacm} {"Journal of the ACM"}
  1008.  
  1009. MACRO {jcss} {"Journal of Computer and System Sciences"}
  1010.  
  1011. MACRO {scp} {"Science of Computer Programming"}
  1012.  
  1013. MACRO {sicomp} {"SIAM Journal on Computing"}
  1014.  
  1015. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  1016.  
  1017. MACRO {tods} {"ACM Transactions on Database Systems"}
  1018.  
  1019. MACRO {tog} {"ACM Transactions on Graphics"}
  1020.  
  1021. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  1022.  
  1023. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  1024.  
  1025. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  1026.  
  1027. MACRO {tcs} {"Theoretical Computer Science"}
  1028.  
  1029. READ
  1030.  
  1031. EXECUTE {init.field.constants}
  1032.  
  1033. FUNCTION {sortify}
  1034. { purify$
  1035.   "l" change.case$
  1036. }
  1037.  
  1038. FUNCTION {author.key.label}
  1039. { author empty$
  1040.     { key empty$
  1041.     { title.field 'field.used := }
  1042.     { key.field 'field.used := }
  1043.       if$
  1044.     }
  1045.     { author.field 'field.used := }
  1046.   if$
  1047. }
  1048.  
  1049. FUNCTION {author.editor.key.label}
  1050. { author empty$
  1051.     { editor empty$
  1052.     { key empty$
  1053.         { title.field 'field.used := }
  1054.         { key.field 'field.used := }
  1055.       if$
  1056.       }
  1057.     { editor.field 'field.used := }
  1058.       if$
  1059.     }
  1060.     { author.field 'field.used := }
  1061.   if$
  1062. }
  1063.  
  1064. FUNCTION {author.key.organization.label}
  1065. { author empty$
  1066.     { key empty$
  1067.     { organization empty$
  1068.         { title.field 'field.used := }
  1069.         { organization.field 'field.used := }
  1070.       if$
  1071.     }
  1072.     { key.field 'field.used := }
  1073.       if$
  1074.     }
  1075.     { author.field 'field.used := }
  1076.   if$
  1077. }
  1078.  
  1079. FUNCTION {editor.key.organization.label}
  1080. { editor empty$
  1081.     { key empty$
  1082.     { organization empty$
  1083.         { title.field 'field.used := }
  1084.         { organization.field 'field.used := }
  1085.       if$
  1086.     }
  1087.     { key.field 'field.used := }
  1088.       if$
  1089.     }
  1090.     { editor.field 'field.used := }
  1091.   if$
  1092. }
  1093.  
  1094. FUNCTION {sort.format.title}
  1095. { 't :=
  1096.   "A " #2
  1097.     "An " #3
  1098.       "The " #4 t chop.word
  1099.     chop.word
  1100.   chop.word
  1101.   sortify
  1102.   #1 global.max$ substring$
  1103. }
  1104.  
  1105. FUNCTION {calc.label}
  1106. { type$ "book" =
  1107.   type$ "inbook" =
  1108.   or
  1109.     'author.editor.key.label
  1110.     { type$ "proceedings" =
  1111.     'editor.key.organization.label
  1112.     { type$ "manual" =
  1113.         'author.key.organization.label
  1114.         'author.key.label
  1115.       if$
  1116.     }
  1117.       if$
  1118.     }
  1119.   if$
  1120.   make.abbr.label
  1121.   title.field field.used =
  1122.     { sort.format.title }
  1123.     { sortify }
  1124.   if$
  1125.   year field.or.null purify$ #-1 #4 substring$ sortify
  1126.   *
  1127.   'sort.label :=
  1128. }
  1129.  
  1130. FUNCTION {first.presort}
  1131. { calc.label
  1132.   sort.label
  1133.   title.field field.used =
  1134.     { skip$ }
  1135.     { "    "
  1136.       *
  1137.       make.list.label sortify
  1138.       *
  1139.       "    "
  1140.       *
  1141.       title field.or.null
  1142.       sort.format.title
  1143.       *
  1144.     }
  1145.   if$
  1146.   #1 entry.max$ substring$
  1147.   'sort.key$ :=
  1148. }
  1149.  
  1150. ITERATE {first.presort}
  1151.  
  1152. SORT
  1153.  
  1154. STRINGS { last.sort.label next.extra }
  1155.  
  1156. INTEGERS { last.extra.num }
  1157.  
  1158. FUNCTION {initialize.last.extra.num}
  1159. { #0 int.to.chr$ 'last.sort.label :=
  1160.   "" 'next.extra :=
  1161.   #0 'last.extra.num :=
  1162. }
  1163.  
  1164. FUNCTION {forward.pass}
  1165. { last.sort.label sort.label =
  1166.     { last.extra.num #1 + 'last.extra.num :=
  1167.       last.extra.num int.to.chr$ 'extra.label :=
  1168.     }
  1169.     { "a" chr.to.int$ 'last.extra.num :=
  1170.       "" 'extra.label :=
  1171.       sort.label 'last.sort.label :=
  1172.     }
  1173.   if$
  1174. }
  1175.  
  1176. FUNCTION {reverse.pass}
  1177. { next.extra "b" =
  1178.     { "a" 'extra.label := }
  1179.     'skip$
  1180.   if$
  1181.   year empty$
  1182.     { "n.d." extra.label * 'list.year := }
  1183.     { year extra.label * 'list.year := }
  1184.   if$
  1185.   extra.label 'next.extra :=
  1186. }
  1187.  
  1188. EXECUTE {initialize.last.extra.num}
  1189.  
  1190. ITERATE {forward.pass}
  1191.  
  1192. REVERSE {reverse.pass}
  1193.  
  1194. FUNCTION {second.presort}
  1195. { make.list.label
  1196.   title.field field.used =
  1197.     { sort.format.title }
  1198.     { sortify }
  1199.   if$
  1200.   "    "
  1201.   *
  1202.   list.year field.or.null sortify
  1203.   *
  1204.   "    "
  1205.   *
  1206.   title.field field.used =
  1207.     { skip$ }
  1208.     { title field.or.null
  1209.       sort.format.title
  1210.       *
  1211.     }
  1212.   if$
  1213.   #1 entry.max$ substring$
  1214.   'sort.key$ :=
  1215. }
  1216.  
  1217. ITERATE {second.presort}
  1218.  
  1219. SORT
  1220.  
  1221. FUNCTION {begin.bib}
  1222. { preamble$ empty$
  1223.     'skip$
  1224.     { preamble$ write$ newline$ }
  1225.   if$
  1226.   "\begin{thebibliography}{xx}" write$ newline$
  1227. }
  1228.  
  1229. EXECUTE {begin.bib}
  1230.  
  1231. EXECUTE {init.state.consts}
  1232.  
  1233. ITERATE {call.type$}
  1234.  
  1235. FUNCTION {end.bib}
  1236. { newline$
  1237.   "\end{thebibliography}" write$ newline$
  1238. }
  1239.  
  1240. EXECUTE {end.bib}
  1241.